package com.example.a14110100409.yuejiandemo.model;


import com.example.a14110100409.yuejiandemo.javabean.ShaiTuInfo;
import com.example.a14110100409.yuejiandemo.service.ActImpls;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/10/18.
 */

public class ShaituModel {
    private Retrofit retrofit;
    private ActImpls shaituservice;

    public ShaituModel() {
        retrofit = new Retrofit
                .Builder()
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    private void service() {
        shaituservice = retrofit.create(ActImpls.class);
    }



    public Call<ShaiTuInfo> getShaiTuInfo(String id, String related) {
        service();
        return shaituservice.getShaiTuInfo(id,related);
    }

    public Call getShaiTuComment(String shaitu_id){
        service();
        return  shaituservice.getShaiTuComment(shaitu_id);
    }

    public Call addShaiTuComment(String shaitu_id, String userid,String reply_userid,String reply){
        service();
        return shaituservice.addShaiTuComment(shaitu_id,userid,reply_userid,reply);
    }


}
